<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    // alert("确认登录")
    window.onclick=function(){
        var a=document.getElementsByTagName('input');
        a[3].onclick=function(){
            var one=Number(a[0].value);
            var two=Number(a[1].value);
            a[2].value=one+two;
        }
        a[4].onclick=function(){
            var one=Number(a[0].value);
            var two=Number(a[1].value);
            a[2].value=one-two;
        }
        a[5].onclick=function(){
            var one=Number(a[0].value);
            var two=Number(a[1].value);
            a[2].value=one*two;
        }
        a[6].onclick=function(){
            var one=Number(a[0].value);
            var two=Number(a[1].value);
            a[2].value=one/two;
        }
        a[7].onclick=function(){
            a[0].value="";
            a[1].value="";
            a[2].value="";
        }
    }
    </script>
    <h3>四则运算</h3>
    <span>数值</span><input type="text" placeholder="求输入第一个数"><br>
    <span>数值</span><input type="text" placeholder="求输入第二个数"><br>
    <span>结果</span><input type="text" placeholder=""><br>
    <input type="button" value="加" >
    <input type="button" value="减" >
    <input type="button" value="乘" >
    <input type="button" value="除" >
    <input type="button" value="重置" >
    
</body>
</html>